import tkinter as tk
from gui import UploadDownload

if __name__ == "__main__":
    # 创建主窗口
    root = tk.Tk()
    root.title("openai-translator")

    upload_download = UploadDownload()

    # 创建上传按钮
    upload_button = tk.Button(root, text="上传文件", command=lambda: upload_download.open_file(file_info_label))
    upload_button.pack(pady=10)

    # 创建文件信息标签
    file_info_label = tk.Label(root, text="")
    file_info_label.pack()

    # 创建翻译按钮
    translate_button = tk.Button(root, text="一键翻译", command=lambda:upload_download.translate_and_download())
    translate_button.pack(pady=10)

    # 运行主循环
    root.mainloop()
